This page last changed on Feb 05, 2010 by kgomes.
Background

In order to really interact with the ESP, it was clear that some level of Ruby integration would really be best in the GUI. For this reason, I turned to JRuby in order to be able to access a Ruby engine from within the GUI. I used the information here:

http://kenai.com/projects/jruby/pages/RedBridge

to get me going. I chose the Embed Core way of doing it as I thought it would be the best way to do what we need to do.

The Ruby environment

In order to understand much about the scripts, the Ruby interpreter uses several environment variables to figure out what context and configuration the ESP is running in. Those variables are:

  1. ESPhome - is the top level (root) directory of the ESP source code tree.
  2. ESPname - is the name of the ESP machine. Note this may be the hostname of the machine that it is running on, minus any "esp" that is prefix removed.
  3. ESPmode - is the operating mode in which to run the ESP software
  4. ESPlog - is the root directory under which all data files are written
  5. ESPpath - is a list of directory to search for mission scripts
  6. ESPconfigPath - is a list of directories to search for configuration files

In the GUI, it can interface with one or more ESP, so basically, these variables should be stored with the instrument information. The strange thing about this is that they will only be applicable on the machine where the ESP software is running, which is NOT where the GUI will be running. The reason to have this information in the GUI however is that at some point the GUI will have to get access to the same source code tree and so even though the ESPhome and ESPlog variables will be different, everything else will be relative to those root directories. Here is a logical deployment of the ESP network and a GUI client.

Interactions

All of the ruby code for interacting with the ESP is located in MBARI's CVS system. In order to reference the ruby scripts, they need to be in the classpath for JRuby. I thought the best way was to have the user point to the head of the directory tree and then basically have the GUI crawl that and build the JRuby classpath dynamically.

The scripts that were active during the ESP's run will be co-located on the FTP server where the logs and images are stored. They will be in a folder called esp2local. So when a user is interested in synchronizing the GUI application with the current files on the shore based FTP station, it should create a local copy of all the files on the FTP directory so that it has a local place to get to the ruby scripts.


GUI ESP Deployment (text/xml)
GUI ESP Deployment (text/xml)
GUI ESP Deployment (text/xml)
GUI ESP Deployment (text/xml)
GUI ESP Deployment (text/xml)
GUI ESP Deployment (text/xml)
Document generated by Confluence on Feb 03, 2026 14:16